﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DoAn_BumTruong_DesignPattern
{
    class MenuCha : Component
    {
        private List<Component> children = new List<Component>();
        public MenuCha(string name)
            : base(name)
        { }
        public override void Add(Component cp)
        {
            children.Add(cp);
        }

        public override List<string> Display()
        {
            List<string> list = new List<string>();
            foreach (Component item in children)
            {
                list.Add(item.Display().ToString());
            }
            return list;
        }
    }
}